package com.jomolangma.app.thinkingjava.io;

//: io/DirectoryDemo.java
// Sample use of Directory utilities.
import java.io.File;

public class DirectoryDemo {
	public static void main(String[] args) {
		// All directories:
		System.out.println(Directory.walk(".").dirs);
		// All files beginning with 'T'
		for (File file : Directory.local(".", "T.*"))
			System.out.println(file);
		System.out.println("----------------------");
		// All Java files beginning with 'T':
		for (File file : Directory.walk(".", "T.*\\.java"))
			System.out.println(file);
		System.out.println("======================");
		// Class files containing "Z" or "z":
		for (File file : Directory.walk(".", ".*[Zz].*\\.class"))
			System.out.println(file);
	}
} /*
 * Output: (Sample) [.\xfiles] .\TestEOF.class .\TestEOF.java .\TransferTo.class
 * .\TransferTo.java ---------------------- .\TestEOF.java .\TransferTo.java
 * .\xfiles\ThawAlien.java ====================== .\FreezeAlien.class
 * .\GZIPcompress.class .\ZipCompress.class
 */// :~
